<template>
  <div class="app-container">
    <div class="filter-container">
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item label="机构名称">
          <el-input v-model="formInline.orgname" placeholder="机构名称" clearable filterable />
        </el-form-item>
        <el-form-item label="用户名称">
          <el-input v-model="formInline.username" placeholder="用户名称" clearable filterable />
        </el-form-item>
        <el-form-item label="日期">
          <div class="block">
            <el-date-picker
              v-model="value2"
              type="daterange"
              align="right"
              unlink-panels
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              :picker-options="pickerOptions"
            />
          </div>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">查询</el-button>
          <el-button type="primary" icon="el-icon-edit" @click="dialogFormVisible = true">添加</el-button>
        </el-form-item>
      </el-form>
    </div>
    <el-table :data="tableData" border style="width: 100%">
      <el-table-column prop="id" label="序号" width="50" />
      <el-table-column prop="user" label="用户" />
      <el-table-column prop="ip" label="操作者ip" />
      <el-table-column prop="menu" label="菜单" />
      <el-table-column prop="org" label="机构" />
      <el-table-column prop="userid" label="用户id" />
      <el-table-column prop="time" label="操作时间" />
      <el-table-column prop="ziduan" label="操作字段" />
    </el-table>
  </div>
</template>
<script>
export default {
  data() {
    return {
      formInline: {
        orgname: '',
        username: '',
        value2: ''
      },
      tableData: [{
        id: '',
        strRolenum: '',
        strRolename: '10008',
        strValue: '系统中心'
      }],
      pickerOptions: {
        shortcuts: [{
          text: '最近一周',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近一个月',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近三个月',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
            picker.$emit('pick', [start, end])
          }
        }]
      },
      value2: ''
    }
  },
  created() {

  },
  methods: {
    onSubmit() {
    }
  }
}
</script>
